﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

/// <summary>
/// Input used for obtaining a nubmer from user
/// </summary>
public partial class NumberInput : ScrumInput
{
    /// <summary>
    /// Gets or sets the float value value.
    /// </summary>
    /// <value>The value.</value>
    public double Value
    {
        get
        {
            return double.Parse(FieldInput.Text);
        }
        set
        {
            this.FieldInput.Text = value.ToString();
        }
    }

    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    public override string ValidationGroup
    {
        get
        {
            return validationGroup;
        }
        set
        {
            validationGroup = value;
            this.RegularExpressionValidatorInput.ValidationGroup = validationGroup;
            this.RequiredFieldValidatorInput.ValidationGroup = validationGroup;
        }
    }

    protected override WebControl GetWebControl()
    {
        return this.FieldInput;
    }

    protected override Label GetLabel()
    {
        return this.FieldLabel;
    }
}
